package com.dianping.cat.consumer.event.model.entity;

import com.dianping.cat.consumer.event.model.BaseEntity;
import com.dianping.cat.consumer.event.model.IVisitor;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;









public class EventName
  extends BaseEntity<EventName>
{
  private String m_id;
  private long m_totalCount;
  private long m_failCount;
  private double m_failPercent;
  private String m_successMessageUrl;
  private String m_failMessageUrl;
  private Map<Integer, Range> m_ranges = new ConcurrentHashMap();

  private double m_tps;

  private double m_totalPercent;

  private GraphTrend m_graphTrend;

/*  33 */   private Map<String, StatusCode> m_statusCodes = new ConcurrentHashMap();





/*  39 */   public EventName(String id) { this.m_id = id; }




/*  44 */   public void accept(IVisitor visitor) { visitor.visitName(this); }


  public EventName addRange(Range range) {
/*  48 */     this.m_ranges.put(range.getValue(), range);
/*  49 */     return this;
  }

  public EventName addStatusCode(StatusCode statusCode) {
/*  53 */     this.m_statusCodes.put(statusCode.getId(), statusCode);
/*  54 */     return this;
  }


  public boolean equals(Object obj) {
/*  59 */     if (obj instanceof EventName) {
/*  60 */       EventName _o = (EventName)obj;

/*  62 */       if (!equals(getId(), _o.getId())) {
/*  63 */         return false;
      }

/*  66 */       return true;
    }

/*  69 */     return false;
  }


/*  73 */   public Range findRange(Integer value) { return (Range)this.m_ranges.get(value); }



/*  77 */   public StatusCode findStatusCode(String id) { return (StatusCode)this.m_statusCodes.get(id); }


  public Range findOrCreateRange(Integer value) {
/*  81 */     Range range = (Range)this.m_ranges.get(value);

/*  83 */     if (range == null) {
/*  84 */       synchronized (this.m_ranges) {
/*  85 */         range = (Range)this.m_ranges.get(value);

/*  87 */         if (range == null) {
/*  88 */           range = new Range(value);
/*  89 */           this.m_ranges.put(value, range);
        }
      }
    }

/*  94 */     return range;
  }

  public StatusCode findOrCreateStatusCode(String id) {
/*  98 */     StatusCode statusCode = (StatusCode)this.m_statusCodes.get(id);

/* 100 */     if (statusCode == null) {
/* 101 */       synchronized (this.m_statusCodes) {
/* 102 */         statusCode = (StatusCode)this.m_statusCodes.get(id);

/* 104 */         if (statusCode == null) {
/* 105 */           statusCode = new StatusCode(id);
/* 106 */           this.m_statusCodes.put(id, statusCode);
        }
      }
    }

/* 111 */     return statusCode;
  }


/* 115 */   public long getFailCount() { return this.m_failCount; }



/* 119 */   public String getFailMessageUrl() { return this.m_failMessageUrl; }



/* 123 */   public double getFailPercent() { return this.m_failPercent; }



/* 127 */   public GraphTrend getGraphTrend() { return this.m_graphTrend; }



/* 131 */   public String getId() { return this.m_id; }



/* 135 */   public Map<Integer, Range> getRanges() { return this.m_ranges; }



/* 139 */   public Map<String, StatusCode> getStatusCodes() { return this.m_statusCodes; }



/* 143 */   public String getSuccessMessageUrl() { return this.m_successMessageUrl; }



/* 147 */   public long getTotalCount() { return this.m_totalCount; }



/* 151 */   public double getTotalPercent() { return this.m_totalPercent; }



/* 155 */   public double getTps() { return this.m_tps; }




  public EventName incFailCount() {
/* 168 */     this.m_failCount++;
/* 169 */     return this;
  }

  public EventName incFailCount(long failCount) {
/* 173 */     this.m_failCount += failCount;
/* 174 */     return this;
  }

  public EventName incTotalCount() {
/* 178 */     this.m_totalCount++;
/* 179 */     return this;
  }

  public EventName incTotalCount(long totalCount) {
/* 183 */     this.m_totalCount += totalCount;
/* 184 */     return this;
  }


  public void mergeAttributes(EventName other) {
/* 189 */     assertAttributeEquals(other, "name", "id", this.m_id, other.getId());

/* 191 */     this.m_totalCount = other.getTotalCount();

/* 193 */     this.m_failCount = other.getFailCount();

/* 195 */     this.m_failPercent = other.getFailPercent();

/* 197 */     this.m_tps = other.getTps();

/* 199 */     this.m_totalPercent = other.getTotalPercent();
  }


/* 203 */   public Range removeRange(Integer value) { return (Range)this.m_ranges.remove(value); }



/* 207 */   public StatusCode removeStatusCode(String id) { return (StatusCode)this.m_statusCodes.remove(id); }


  public EventName setFailCount(long failCount) {
/* 211 */     this.m_failCount = failCount;
/* 212 */     return this;
  }

  public EventName setFailMessageUrl(String failMessageUrl) {
/* 216 */     this.m_failMessageUrl = failMessageUrl;
/* 217 */     return this;
  }

  public EventName setFailPercent(double failPercent) {
/* 221 */     this.m_failPercent = failPercent;
/* 222 */     return this;
  }

  public EventName setGraphTrend(GraphTrend graphTrend) {
/* 226 */     this.m_graphTrend = graphTrend;
/* 227 */     return this;
  }

  public EventName setId(String id) {
/* 231 */     this.m_id = id;
/* 232 */     return this;
  }

  public EventName setSuccessMessageUrl(String successMessageUrl) {
/* 236 */     this.m_successMessageUrl = successMessageUrl;
/* 237 */     return this;
  }

  public EventName setTotalCount(long totalCount) {
/* 241 */     this.m_totalCount = totalCount;
/* 242 */     return this;
  }

  public EventName setTotalPercent(double totalPercent) {
/* 246 */     this.m_totalPercent = totalPercent;
/* 247 */     return this;
  }

  public EventName setTps(double tps) {
/* 251 */     this.m_tps = tps;
/* 252 */     return this;
  }

  public EventName() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/event/model/entity/EventName.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */